﻿var flag = "";
//初始化
if (typeof ($) != "undefined") {
    $(document).ready(function () {
        flag = getPar1("flag");
        var CategoryID = getPar1("CategoryID");
        var CategoryName = decodeURI(getPar1("CategoryName"));
        //alert("CategoryID:" + CategoryID + " CategoryName:" + CategoryName);
        if (flag == "add") {
            $("#CateoryID").val(CategoryID)
        }
        if (flag == "view") {
            parent.setButtonHiden();
            $("div input").attr("disabled", true).css("background", "whitesmoke");
            $("div textarea ").css("background", "whitesmoke");
            $("div select ").attr("disabled", true).css("background", "whitesmoke");
            $("div input[type=button]").hide();
        }

        $("#CateoryName").val(CategoryName);
    });
    //instance[0].AddTime = new Date();
}

var fnCheckData = function () {
    try {
        if ($("#ItemName").val() == "") {
            return "【考核项目名称】不能为空!";
        }
        if ($("#CategoryID").val() == "") {
            return "【所属分类】不能为空!";
        }
    }
    catch (e)
     { }
}
